package com.zr.gdms.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zr.gdms.service.AdminTeacherService;
import com.zr.gdms.serviceimpl.AdminTeacherServiceImpl;
/**
 * 删除教师
 * @author 李培宁
 *
 */
public class DeleteTeacherControllerLPN extends HttpServlet{

	AdminTeacherService ats = new AdminTeacherServiceImpl();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		this.doPost(req, resp);
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		
		String appstate = "true";
		String apptype = req.getParameter("apptype");
		boolean flag = ats.deleteTeacher(appstate, apptype);
		PrintWriter pw = resp.getWriter();
		if (flag) {
			pw.write("1");
		} else {
			pw.write("0");
		}
		pw.flush();
		pw.close();
	}
}
